<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">

		</style>
	</head>

	<body>
		<div id="box">
			文本<input type="text" id="ipt1" placeholder="请输入文本" /> <br /> 
			密码<input type="password" id="ipt2" placeholder="请输入密码" /> <br /> 
			颜色<input type="color" id="ipt3" /> <br /> 
			日期<input type="date" id="ipt4" /> <br /> 
			日期加时间<input type="datetime" id="ipt5" /> <br /> 
			月份<input type="month" id="ipt6" /> <br /> 
			小时<input type="time" id="ipt7" /> <br /> 
			文本域<input type="texttarea" id="ipt8" /> <br />
		</div>
		<br />
		<br />
		<br />
		<br />
		<br />
		<button type="button" id="bt1" onclick="fn1()">
			获取ipt的内容
		</button>
		<button type="button" id="bt1" onclick="fn2()">
		       给所有ipt的设置value值
		</button>
		<br />
		<br />
		<br />
		<br />
		<br />
		
		<script type="text/javascript">
			//获取value
			function fn1() {
				var ipt1 = document.getElementById("ipt1");
				var ipt1value = ipt1.value;
				console.log("ipt1Value:", ipt1Value);
			}
			//设置默认值   可以做清除输入的内容 ipt1.value=""
			function fn2() {
				var ipt1 = document.getElementById("ipt1");
				ipt1.value = "这是ipt1的默认值";
			}

			
		</script>
	</body>

</html>
